package com.lxb.cmsservice.controller;

import com.lxb.cmsservice.entity.CrmBanner;
import com.lxb.cmsservice.service.CrmBannerService;
import com.lxb.commonutils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 前台管理控制层
 *
 * @author xuebin.li
 * @createTime 2022/12/11 13:19
 */
@Api(description = "前台管理控制层")
@RestController
@RequestMapping("/eduCms/bannerFront")
//@CrossOrigin
public class BannerFrontController {

    @Autowired
    private CrmBannerService bannerService;

    @ApiOperation("获取轮播图数据")
    @GetMapping("/getAllBanner")
    public R  getBanner(){
        List<CrmBanner> bannerList = bannerService.getAllList();
        return R.ok().data("bannerList",bannerList);
    }
}
